﻿using H2.NET.Business;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Ultimus.OC;

namespace H2.NET.Web.Pages.SMD.Helper
{
    public class UserHelper
    {
        public static t_User GetUserAPI()
        {
            return HttpContext.Current.Session["UserAPI"] as t_User;
        }

        /// <summary>
        /// 根据用户名获取OC中的用户信息
        /// </summary>
        /// <param name="username">用户名</param>
        /// <returns>OC User</returns>
        public static User GetOcUser(string username)
        {
            var oc = new OrgChart();
            User ocUser;
            oc.FindUser(username, "", 0, out ocUser);

            return ocUser;
        }
    }
}